<?php
declare (strict_types = 1);

namespace app\admin\controller;
use app\admin\middleware\Auth;
use app\model\RedisModel;
use think\App;
use \app\model\BaseOrderStatus as BaseOrderStatusModel;

class BaseOrderStatus extends Base {

    protected $middleware = [Auth::class];
    private $baseOrderStatusModel;

    public $cacheKey="base:order:status:id:";


    public function __construct(App $app)
    {
        parent::__construct($app);

        $this->baseOrderStatusModel = new BaseOrderStatusModel();

        $this->isLogin();
    }



    /*
     * 获取店铺列表
     * */
    public function getList(){

        $list = $this->baseOrderStatusModel->getList();

        $total = $this->baseOrderStatusModel->getTotal();

        return $this->succData($total,$list);
    }



    public function delCache($id)
    {
        $redisModel = new RedisModel();

        return $redisModel->delete($this->cacheKey.$id);
    }


    public function delAllCache()
    {
        $redisModel = new RedisModel();

        return $redisModel->deleteAll($this->cacheKey);
    }
}
